#include <changeloddialog.h>
#include <stdio.h>

ChangeLODDialog::ChangeLODDialog(ManualLevelOfDetailSolver* solver, QWidget* parent)
  : QDialog (parent, Qt::Popup)
  , _solver(solver)
{
  _gui.setupUi(this);


  _gui.slider->blockSignals(true);
  _gui.slider->setMinimum(0);
  _gui.slider->setMaximum(_solver->GetNum()-1);
  _gui.slider->setValue(_solver->GetEntry());
  _gui.slider->blockSignals(false);
}

void ChangeLODDialog::on_pushButtonOk_clicked()
{
  close ();
}


void ChangeLODDialog::on_slider_valueChanged(int value)
{
  _solver->SetEntry(value);
  emit Changed();
}

